<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<%@ page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<x:multiLanguage>
	<HEAD>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">

<link href="../css/dialog.css" rel="stylesheet" type="text/css" />
<link href="../css/ddtabmenu_dialog.css" rel="stylesheet"
	type="text/css" />

<script src='<s:url value="/dwr/engine.js"/>'></script>
<script src='<s:url value="/dwr/util.js"/>'></script>

<script language=JavaScript src="sequence.js"></script>
<script language=JavaScript src="dialog.js"></script>
<script language=JavaScript src="script.js"></script>

<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script language="JavaScript"
	src='<s:url value="/script/jquery/jquery-1.4.2.js" />'></script>
<script language="JavaScript"
	src='<s:url value="/script/ddtabmenufiles/ddtabmenu.js" />'></script>

<SCRIPT language=JavaScript>
	var dialog = window.parent;
	var oEditor = dialog.InnerDialogLoaded();
	var oDOM = oEditor.FCK.EditorDocument;
	var oActiveEl = dialog.Selection.GetSelectedElement();

	function Ok() {
		if (ev_check()) {
			var isok = true;
			oEditor.FCKUndo.SaveUndoStep();
			//var id=getFieldId();	
			var json = getFormJSON(); // 查看dialog.js
			json['className'] = "cn.myapps.core.dynaform.form.ejb.RadioField";
			oActiveEl = CreateNamedElement(oEditor, oActiveEl, 'INPUT', json);

			return true;
		}
	}

	//检查内容是否完成正确
	function ev_check() {
		if (temp.name.value == '') {
			alert("{*[page.name.notexist]*}");
			return false;
		}
		return !checkStartChar(temp.name.value);
	}

	function checkStartChar(value) {
		return IsDigit(value, "{*[page.name.startingit]*}");
	}

	$(function() {
		oEditor.FCKLanguageManager.TranslatePage(document);

		if (oActiveEl && (oActiveEl.tagName == 'INPUT')) {
			setFormByObject(oActiveEl); // 查看dialog.js
			var items = HTMLDencode(oActiveEl.processDescription);
			parseRelStr(items);
		} else {
			oActiveEl = null;
		}

		ddtabmenu.definemenu("tabs", "t1");
		dialog.SetOkButton(true);
		dialog.SetAutoSize(true);
		//initForm();
		modeChange($("input[name=editMode]:checked").val());
		resize();
		SelectField('name');
	});
</script>

	</HEAD>

	<BODY bgcolor=menu>
		<form name="temp">
			<div id="tabs" class="basictab">
				<ul>
					<li><a id="t1" rel="tabs-1">{*[Basic]*}</a>
					</li>
					<li><a id="t2" rel="tabs-2">{*[Value_Script]*}</a>
					</li>
					<li><a id="t3" rel="tabs-3">{*[Option_Script]*}</a>
					</li>
					<li><a id="t4" rel="tabs-4">{*[Validate_Script]*}</a>
					</li>
					<li><a id="t5" rel="tabs-5">{*[Hidden_Script]*}</a>
					</li>
					<li><a id="t6" rel="tabs-6">{*[Hidden_Print_Script]*}</a>
					</li>
					<li><a id="t7" rel="tabs-7">{*[ReadOnly_Script]*}</a>
					</li>
				</ul>
			</div>

			<div id="contents">
				<div id="tabs-1">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content1">
						<tr>
							<td class="commFont commLabel">{*[Name]*}:</td>
							<td colspan="3"><input type=text name="name"
								onchange="checkStartChar(this.value);">
							</td>
						</tr>

						<tr>
							<td class="commFont commLabel">{*[Layout]*}:</td>
							<td><select name="layout">
									<option value="horizontal" selected>{*[Horizontal]*}</option>
									<option value="vertical">{*[Vertical]*}</option>
							</select></td>
							<td class="commFont commLabel">{*[TextType]*}:</td>
							<td><select name="textType">
									<option value="text" selected>{*[Common]*}</option>
									<option value="readonly">{*[Readonly]*}</option>
							</select></td>
						</tr>
						<tr>
							<td colspan="4" align="center"><input type=checkbox
								name="refreshOnChanged" value="true">{*[Refresh]*}&nbsp;
								<input type=checkbox name="calculateOnRefresh" value="true">{*[Recalculate]*}&nbsp;
								<input type=checkbox name="mobile" value="true" checked />{*[Mobile]*}
							</td>
						</tr>

						<tr>
							<td class="commFont commLabel">{*[Description]*}:</td>
							<td colspan="3"><textarea name="discript"
									style="width: 100%" rows="7"></textarea>
							</td>
						</tr>
					</table>
				</div>
				<div id="tabs-2">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content2">
						<tr>
							<%@include file="commondialog.jsp"%>
						</tr>
					</table>
				</div>
				<div id="tabs-3">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content3">
						<tr>
							<td><textarea name="optionsScript" style="width: 96%"
									rows="10"></textarea>
								<button style="border: 0px; cursor: pointer;"
									onclick="openIscriptEditor('optionsScript','{*[Script]*}{*[Editor]*}','{*[Option_Script]*}','name','{*[Save]*}{*[Success]*}');">
									<img alt="Open with IscriptEditor"
										src="<s:url value='/resource/image/editor.png' />" />
								</button></td>
						</tr>
					</table>
				</div>
				<div id="tabs-4">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content4">
						<tr>
							<td width="25%">
								<table>
									<tr>
										<td><input type="checkbox" name="validateLibs"
											value="validateLibsId1" class="store" />validateLibsName1 <input
											type="checkbox" name="validateLibs" value="validateLibsId2"
											class="store" />validateLibsName2</td>
									</tr>
								</table></td>
							<td width="75%"><textarea name="validateRule"
									style="width: 95%" rows="10"></textarea>
								<button style="border: 0px; cursor: pointer;"
									onclick="openIscriptEditor('validateRule','{*[Script]*}{*[Editor]*}','{*[Validate_Script]*}','name','{*[Save]*}{*[Success]*}');">
									<img alt="Open with IscriptEditor"
										src="<s:url value='/resource/image/editor.png' />" />
								</button></td>
						</tr>
					</table>
				</div>
				<div id="tabs-5">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content5">
						<tr>
							<td><textarea name="hiddenScript" style="width: 96%"
									rows="10"></textarea>
								<button style="border: 0px; cursor: pointer;"
									onclick="openIscriptEditor('hiddenScript','{*[Script]*}{*[Editor]*}','{*[Hidden_Script]*}','name','{*[Save]*}{*[Success]*}');">
									<img alt="Open with IscriptEditor"
										src="<s:url value='/resource/image/editor.png' />" />
								</button></td>
						</tr>
						<tr>
							<td>{*[hiddenValue]*}：<input id="hiddenValue" type="text"
								name="hiddenValue" />
							</td>
						</tr>
					</table>
				</div>
				<div id="tabs-6">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content6">
						<tr>
							<td><textarea name="hiddenPrintScript" style="width: 96%"
									rows="10"></textarea>
								<button style="border: 0px; cursor: pointer;"
									onclick="openIscriptEditor('hiddenPrintScript','{*[Script]*}{*[Editor]*}','{*[Hidden_Print_Script]*}','name','{*[Save]*}{*[Success]*}');">
									<img alt="Open with IscriptEditor"
										src="<s:url value='/resource/image/editor.png' />" />
								</button></td>
						</tr>
						<tr>
							<td>{*[Print]*}{*[hiddenValue]*}：<input type="text"
								name="printHiddenValue" />
							</td>
						</tr>
					</table>
				</div>
				<div id="tabs-7">
					<table border=1 cellpadding=3 cellspacing=1 class="content"
						id="content7">
						<tr>
							<td><textarea name="readonlyScript" style="width: 96%"
									rows="10"></textarea>
								<button style="border: 0px; cursor: pointer;"
									onclick="openIscriptEditor('readonlyScript','{*[Script]*}{*[Editor]*}','{*[ReadOnly_Script]*}','name','{*[Save]*}{*[Success]*}');">
									<img alt="Open with IscriptEditor"
										src="<s:url value='/resource/image/editor.png' />" />
								</button></td>
						</tr>
					</table>
				</div>
			</div>
		</form>
	</BODY>
</x:multiLanguage>
</HTML>
